<form action="{:U(contacts/excelImport)}" method="post" enctype="multipart/form-data">
	<table class="table table-hover">
		<tr>
			<td class="tdleft" width="20%">{:L('FILE_REQUIRES')}:</td> 
			<td>{:L('FILE_REQUIRES_CONTENT')}
			<p>{:L('ALLOWED_FILE_TYPE')}</p></td>
		</tr>
		<tr>
			<td class="tdleft" width="20%">{:L('ERROR_HANDLING')}</td> 
			<td>
				<input id="ownership" type="radio" checked="checked" value="0" name="error_handing">{:L('END')}
				<input id="ownership1" type="radio" value="1" name="error_handing">{:L('SKIP')}
			</td>
		</tr>
		<tr>
			<td class="tdleft">{:L('SELECT_FILE_TO_IMPORT')}</td>
			<td><p id="attachment1"><input type="file" name="excel"/></p><p style="color:red">{:L('IMPORT_TIPS')}&nbsp;<a href="__PUBLIC__/excelmodel/5kcrm_contacts_model.xls">{:L('CLICK_TO_DOWNLOAD')}</a></p></td>
		</tr>
		<tr>
			<td class="tdleft">{:L('OWNER_ROLE')}</td>
			<td>
				<input type="hidden" id="owner_id" name="owner_role_id" value="{$Think.session.role_id}"/><input type="text" id="owner_name" value="{$Think.session.name}" name="owner_name"/>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input class="btn btn-primary" type="submit" name="submit" value="{:L('IMPORT')}"/> &nbsp; <input class="btn" onclick="javascript:$('#dialog-import').dialog('close');" type="button" value="{:L('CANCEL')}"/></td>
		</tr>
	</table>
</form>
<div class="hide" id="dialog-role-list" title="{:L('CHOOSE_CLUES')}">loading...</div>
<script type="text/javascript">
$("#dialog-role-list").dialog({
	autoOpen: false,
	modal: true,
	width: 600,
	maxHeight: 400,
	buttons: {
		"Ok": function () {
			var item = $('input:radio[name="owner"]:checked').val();
			var name = $('input:radio[name="owner"]:checked').parent().next().html();
			$('#owner_name').val(name);
			$('#owner_id').val(item);
			$(this).dialog("close"); 
		},
		"Cancel": function () {
			$(this).dialog("close");
		}
	},
	position: ["center", 100]
});
$(function(){
	$('#owner_name').click(
		function(){
			$('#dialog-role-list').dialog('open');
			$('#dialog-role-list').load("{:U('user/listDialog')}");
		}
	);
	$('#remove').click(
		function(){
			$('#owner_id').attr('value', '');
			$('#owner_name').attr('value', '');
		}
	);
});
</script>